<?php

namespace Modules\Edu\Policies;

use App\User;
use Illuminate\Auth\Access\HandlesAuthorization;
use Modules\Edu\Entities\System;

class SystemPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */

    public function before($user, $ability, $site = null)
    {
        //强制处理，需要取消
        if (access('system',false)) {

            return true;

        }

    }

    public function edit(User $user, System $system)
    {

        return $user['id']==$system['user_id'];
    }

}
